package com.summerxia.dateselector.wheelview;

import android.content.Context;

import com.summerxia.dateselector.R;

import java.util.Arrays;
import java.util.List;

public class NewsCompontentsAdapter implements WheelAdapter {

	private List<String> newsCompontents;
	private Context context;

	public NewsCompontentsAdapter(Context context){
		super();
		this.context = context;
	}


	public void setNewsCompontents(List<String> newsCompontents) {
		this.newsCompontents = newsCompontents;
	}

	@Override
	public int getItemsCount() {
		return newsCompontents == null ? 0 : newsCompontents.size();
	}

	@Override
	public String getItem(int index) {
		return index <= newsCompontents.size() - 1 ? newsCompontents.get(index) : null;
	}

	@Override
	public int getMaximumLength() {
		return 20;
	}
	
	@Override
	public String getCurrentId(int index) {
		return "" + index ;
	}

}
